package automateWebElements;

import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;

public class Assertions {
    public static void main(String[] args) {
        FirefoxDriver driver = new FirefoxDriver();
        driver.get("https://rahulshettyacademy.com/dropdownsPractise/");


        Assert.assertFalse(driver.findElementByCssSelector("input[id*='SeniorCitizenDiscount']").isSelected());
        driver.findElementByCssSelector("input[id*='SeniorCitizenDiscount']").click();
        Assert.assertTrue(driver.findElementByCssSelector("input[id*='SeniorCitizenDiscount']").isSelected());
        Assert.assertEquals(driver.findElementByXPath("//label[@for='ctl00_mainContent_chk_friendsandfamily']").getText(),"Family and Friends");

        //nr of all checkboxes
        System.out.println("NR of checkboxes on site : "+driver.findElementsByCssSelector("input[type='checkbox']").size());


    }
}
